package com.vegetable.modules.entity.finance.po;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import com.vegetable.common.base.BaseEntity;
import com.vegetable.modules.entity.finance.PaymentAccountRelease;
import com.vegetable.modules.entity.finance.PaymentPurchaseDetail;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import org.springframework.format.annotation.DateTimeFormat;

import java.math.BigDecimal;
import java.util.Date;
import java.util.List;

/**
 * <p>
 * 采购/代办付款
 * </p>
 *
 * @author wangruijie
 * @since 2024-04-15
 */
@Data
@EqualsAndHashCode(callSuper = false)
@ApiModel(value="PaymentPurchase对象", description="采购/代办付款")
public class PaymentPurchaseAddPO extends BaseEntity {

    @ApiModelProperty(value = "生产者ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long producerId;

    @ApiModelProperty(value = "单据编号")
    private String docNo;

    @ApiModelProperty(value = "付款状态 0结账未付，1实际已付")
    private Integer state;

    @ApiModelProperty(value = "审批状态 0未提交审批，1审批中，2审批通过，3审批拒绝")
    private Integer approvalState;

    @ApiModelProperty(value = "状态0采购付款，1代办付款")
    private Integer orderType;

    @ApiModelProperty(value = "农户代办ID")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long customerId;
    @TableField(exist = false)
    private Long agentId;

    @ApiModelProperty(value = "农户代办名称")
    private String customerName;

    @ApiModelProperty(value = "账户id")
    @JsonSerialize(using = ToStringSerializer.class)
    private Long accountId;

    @ApiModelProperty(value = "账户名称")
    private String accountName;

    @ApiModelProperty(value = "订单时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date orderTime;

    @ApiModelProperty(value = "结账区间开始")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date startTime;

    @ApiModelProperty(value = "结账区间结束")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date endTime;

    @ApiModelProperty(value = "金额")
    private BigDecimal money;

    @ApiModelProperty(value = "折扣金额")
    private BigDecimal discount;

    @ApiModelProperty(value = "全局折扣金额")
    private BigDecimal globalDiscount;

    @ApiModelProperty(value = "打款时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date remitTime;

    @ApiModelProperty(value = "备注")
    private String remark;

    @ApiModelProperty(value = "创建者ID")
    private Long createUserId;

    @ApiModelProperty(value = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(locale = "zh", timezone = "GMT+8", pattern = "yyyy-MM-dd")
    private Date createTime;

    @ApiModelProperty(value = "付款明细")
    @TableField(exist = false)
    private List<PaymentPurchaseDetail> payDetails;

    @ApiModelProperty(value = "付款账户列表")
    @TableField(exist = false)
    List<PaymentAccountRelease> accountReleases;
}